package com.jayson.demo.controller;

import com.jayson.demo.service.DemoService;
import com.jayson.mymvc.annotations.Autowired;
import com.jayson.mymvc.annotations.Controller;
import com.jayson.mymvc.annotations.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("/demo2")
public class Demo2Controller {

    @Autowired
    private DemoService demoService;

    @RequestMapping("/test")
    public void test(HttpServletRequest req, String name, HttpServletResponse resp) throws IOException {
        resp.setHeader("Content-type", "text/html;charset=UTF-8");
        resp.getWriter().write("name:" + name);
        return ;
    }



}
